
// Copyright (C) 2012 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//  
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//  
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System.Collections.Generic;

namespace Derm.Xml.Collada
{
	/// <summary>
	/// A group that specifies the allowable types for GLSL profile parameters.
	/// </summary>
	public class ColladaFxGlslParamType : ColladaXmlSerializable
	{
		#region Constructors

		/// <summary>
		/// Construct a ColladaFxGlslParamType.
		/// </summary>
		/// <param name="parent">
		/// The parent element containing this ColladaFxGlslParamType.
		/// </param>
		public ColladaFxGlslParamType(ColladaXmlSerializable parent) : base(parent)
		{
			
		}

		#endregion

		#region GLSL FX Param Type Information

		/// <summary>
		/// The value.
		/// </summary>
		public object Value;

		#endregion

		#region ColladaXmlSerializable Overrides

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementBool = "bool";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementBool2 = "bool2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementBool3 = "bool3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementBool4 = "bool4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementInt = "int";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementInt1 = "int1";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementInt2 = "int2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementInt3 = "int3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementInt4 = "int4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat = "float";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat2 = "float2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat3 = "float3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat4 = "float4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat1x1 = "float1x1";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat1x2 = "float1x2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat1x3 = "float1x3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat1x4 = "float1x4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat2x1 = "float2x1";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat2x2 = "float2x2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat2x3 = "float2x3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat2x4 = "float2x4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat3x1 = "float3x1";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat3x2 = "float3x2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat3x3 = "float3x3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat3x4 = "float3x4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat4x1 = "float4x1";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat4x2 = "float4x2";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat4x3 = "float4x3";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementFloat4x4 = "float4x4";

		/// <summary>
		/// Collada 'glsl_param_type' child element name (1.4).
		/// </summary>
		private const string ColladaElementEnum = "enum";

		#endregion
	}

	/// <summary>
	/// This element creates a new, named param object in the FX Runtime, assigns it a type, an initial value,
	/// and additional attributes at declaration time.
	/// </summary>
	public class ColladaFxGlslNewParam : ColladaXmlSerializable
	{
		#region Constructors

		/// <summary>
		/// Construct a ColladaFxGlslNewParam.
		/// </summary>
		/// <param name="parent">
		/// The parent element containing this ColladaFxGlslNewParam.
		/// </param>
		public ColladaFxGlslNewParam(ColladaXmlSerializable parent) : base(parent)
		{
			
		}

		#endregion

		#region GLSL FX Profile New Param Information

		/// <summary>
		/// The annotate element allows you to specify an annotation for this new param.
		/// </summary>
		public List<ColladaFxAnnotate> Annotations = new List<ColladaFxAnnotate>();

		/// <summary>
		/// The semantic element allows you to specify a semantic for this new param.
		/// </summary>
		public string Semantic;

		/// <summary>
		/// The modifier element allows you to specify a modifier for this new param.
		/// </summary>
		public ColladaFxModifier Modifier;

		/// <summary>
		/// 
		/// </summary>
		public ColladaFxGlslParamType ParamType; 

		#endregion

		#region ColladaCommonFxBasicType Overrides

		/// <summary>
		/// Collada 'fx_newparam_common' attribute name (1.4).
		/// </summary>
		private const string ColladaAttributeSid = "sid";

		/// <summary>
		/// Collada 'fx_newparam_common' child element name (1.4).
		/// </summary>
		private const string ColladaElementAnnotate = "annotate";

		/// <summary>
		/// Collada 'fx_newparam_common' child element name (1.4).
		/// </summary>
		private const string ColladaElementSemantic = "semantic";

		/// <summary>
		/// Collada 'fx_newparam_common' child element name (1.4).
		/// </summary>
		private const string ColladaElementModifier = "modifier";

		#endregion
	}

	/// <summary>
	/// Opens a block of GLSL platform-specific data types and technique declarations.
	/// </summary>
	public class ColladaFxGlslProfile : ColladaFxProfile
	{
		#region Constructors

		/// <summary>
		/// Construct a ColladaFxGlslProfile.
		/// </summary>
		/// <param name="parent">
		/// The parent element containing this ColladaFxGlslProfile.
		/// </param>
		public ColladaFxGlslProfile(ColladaXmlSerializable parent) : base(parent)
		{
			
		}

		#endregion

		#region GLSL Fx Profile Information

		/// <summary>
		/// The id attribute is a text string containing the unique identifier of this element.
		/// This value must be unique within the instance document. Optional attribute.
		/// </summary>
		public string Id;

		/// <summary>
		/// The GLSL element may contain an asset element.
		/// </summary>
		public ColladaAsset Asset;

		/// <summary>
		/// The profile codes.
		/// </summary>
		public List<ColladaFxProfileSource> Codes = new List<ColladaFxProfileSource>();

		/// <summary>
		/// The profile included codes.
		/// </summary>
		public List<ColladaFxProfileInclude> Includes = new List<ColladaFxProfileInclude>();

		/// <summary>
		/// 
		/// </summary>
		public List<ColladaImage> Images = new List<ColladaImage>();

		/// <summary>
		/// 
		/// </summary>
		public List<ColladaTechnique> Techniques = new List<ColladaTechnique>();

		/// <summary>
		/// The extra element may appear any number of times.
		/// </summary>
		public List<ColladaExtra> Extras = new List<ColladaExtra>();

		#endregion

		#region ColladaFxProfile Overrides

		/// <summary>
		/// The name that identifies this profile.
		/// </summary>
		public override string ProfileName { get { return ("GLSL"); } }

		/// <summary>
		/// Modify a set of parameters defining an effect.
		/// </summary>
		/// <param name="shaderParameters">
		/// A <see cref="ColladaShaderParameters"/> that hols the current parameters for defining a
		/// COLLADA effect.
		/// </param>
		internal override void CompileShaderParameters(ColladaShaderParameters shaderParameters)
		{
			
		}

		#endregion
	}
}
